package com.sys.dao;

import java.sql.SQLException;
import java.util.List;

import com.sys.domain.File;

public interface FileDao {
	/**
	 * @Title: insertRecord 
	 * @Description: TODO(向file表中插入一条记录) 
	 * @param file
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean insertRecord(File file) throws SQLException;
	
	/**
	 * @Title: changeStatus 
	 * @Description: TODO(改变文件的状态) 
	 * @param fileName status
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean changeStatus(String fileId, String status) throws SQLException;
	
	/**
	 * @Title: isFileExist 
	 * @Description: TODO(根据文件号判断文件是否存在) 
	 * @param @param fileId
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean isFileExist(String fileId) throws SQLException;
	
	/**
	 * @Title: deleteFile 
	 * @Description: TODO(根据文件号删除文件) 
	 * @param @param fileId
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean deleteFile(String fileId) throws SQLException;
	
	/**
	 * @Title: findAllFileThatCanBeDownload 
	 * @Description: TODO(查询所有可以被下载的文件) 
	 * @return List<File>
	 * @throws SQLExceptionl
	 */
	List<File> findAllFileThatCanBeDownload() throws SQLException;
	
	/**
	 * @Title: findFileThatUserSearch 
	 * @Description: TODO(用户查询文件) 
	 * @param fileId
	 * @return List<File>
	 * @throws SQLException
	 */
	List<File> findFileThatUserSearch(String fileId) throws SQLException;
	
	/**
	 * @Title: findFileThatUserUpload 
	 * @Description: TODO(查询某用户上传的文件)
	 * @param upId
	 * @return List<File>
	 * @throws SQLException
	 */
	List<File> findFileThatUserUpload(String upId) throws SQLException;
	
	/**
	 * @Title: allFiles 
	 * @Description: TODO(查询数据库中所有的文件，包括可下载和不可下载) 
	 * @return List<File>
	 * @throws SQLException
	 */
	List<File> allFiles() throws SQLException;
	
	/**
	 * @Title: changeFileType 
	 * @Description: TODO(修改相应文件的类型) 
	 * @param fileId FileType
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean changeFileType(String fileId, String fileType) throws SQLException;
}
